<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            list-style: none;
            box-sizing: border-box;
        }
        
        .warp {
            width: 1000px;
            height: 500px;
            margin: 50px auto;
        }
        
        .list {
            width: 180px;
            height: 500px;
            float: left;
        }
        
        .list li {
            margin-top: 5px;
        }
        
        .list li.qw {
            border: 2px solid red;
        }
        
        .list img {
            width: 180px;
        }
        
        .lit {
            width: 700px;
            height: 500px;
            float: left;
            margin-left: 20px;
        }
        
        .lit li {
            display: none;
        }
        
        .lit li.qw {
            display: block;
        }
        
        .lit img {
            width: 700px;
            height: 450px;
        }
    </style>
</head>

<body>
    <div class="warp">
        <ul class="list">
            <!-- <li class="qw"><img src="./img/324167.jpg" alt=""></li>
            <li><img src="./img/331872.jpg" alt=""></li>
            <li><img src="./img/331874.jpg" alt=""></li>
            <li><img src="./img/331930.jpg" alt=""></li> -->
        </ul>
        <ul class="lit">
            <!-- <li class="qw"><img src="./img/324167.jpg" alt=""></li>
            <li><img src="./img/331872.jpg" alt=""></li>
            <li><img src="./img/331874.jpg" alt=""></li>
            <li><img src="./img/331930.jpg" alt=""></li> -->
        </ul>
    </div>
    <script>
        var ju = ['./img/324167.jpg', './img/331872.jpg', './img/331874.jpg', './img/331930.jpg'];
        var list = document.querySelector('.list');
        var lit = document.querySelector('.lit');
        var logo = function(item) {
            list.innerHTML = lit.innerHTML = ju.map(function(item, index) {
                return `<li class="${index===0?'qw':''}"><img src="${item}" alt=""></li>`
            }).join('');
        };
        logo();
        [...list.children].forEach(function(item, index) {
            item.onclick = function() {
                document.querySelector('.list .qw').classList.remove('qw');
                list.children[index].classList.add('qw');
                document.querySelector('.lit .qw').classList.remove('qw');
                lit.children[index].classList.add('qw');
            }
        })
    </script>
</body>

</html>